package com.kusiri.kframework.metadata
{
	import com.kusiri.kframework.ui.IKfUiContainer;
	
	import flash.utils.getDefinitionByName;
	
	public class KfUiContainerConfiguration
	{
		public var clazz : String;
		
		public function KfUiContainerConfiguration()
		{
		}
		
		/**
		 * 
		 */
		public function getNewUiContainer() : IKfUiContainer
		{
			var clazz : Class = getDefinitionByName(clazz) as Class;
			return new clazz();
		}
		
		/**
		 * 
		 */
		public static function fromXml( xml : XML ) : KfUiContainerConfiguration
		{
			var conf : KfUiContainerConfiguration = new KfUiContainerConfiguration();
			conf.clazz = xml.@clazz;
			return conf;
		}
		
		/**
		 * 
		 */
		public function toXml() : XML
		{
			return <uicontainer clazz={clazz}/>;
		}

	}
}